package com.llf.Blog.ServiceImpl;


import com.llf.Blog.Pojo.Tag;
import com.llf.Blog.Mapper.TagMapper;
import com.llf.Blog.Service.TagService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author llf
 * @since 2021-08-07
 */
@Transactional(rollbackFor=Exception.class)
@Service
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {

    @Autowired
    private TagMapper tagMapper;
    @Override
    public Tag getById(Long id) {
        return tagMapper.getById(id);
    }
    @Override
    public List<Tag> getAll() {
        return tagMapper.getAll();
    }

    @Override
    public Boolean insertTag(Tag tag) {
        return tagMapper.insertTag(tag);
    }
    @Override
    public Boolean update(Tag tag) {
        return tagMapper.update(tag);
    }

    @Override
    public Boolean deleteById(long id) {
        return tagMapper.deleteById(id);
    }

    @Override
    public Tag getByName(String name) {
        return tagMapper.getByName(name);
    }
}
